#!/bin/bash
FILE="ep.js"
LAST_MODIFY=$(stat -c %Y $FILE)

while true; do
  CURRENT_MODIFY=$(stat -c %Y $FILE)
  if [ $CURRENT_MODIFY != $LAST_MODIFY ]; then
    echo "File has been modified"
    $(./stop.sh)
    $(./start.sh)
    LAST_MODIFY=$CURRENT_MODIFY
  fi
  sleep 2
done
